﻿using GameCreator.Core;
using PixelCrushers.DialogueSystem;
using QFramework;
using UnityEngine;

namespace Gp.GCX {
    [AddComponentMenu("")]
    public class DlsTriggerCondition : ICondition {
        public DialogueSystemTrigger trigger;

        private void Reset() {
            trigger = this.GetOrAddComponent<PixelCrushers.DialogueSystem.Wrappers.DialogueSystemTrigger>();
            trigger.trigger = DialogueSystemTriggerEvent.None;
        }

        public override bool Check(GameObject target, params object[] parameters) {
            return trigger.condition == null || trigger.condition.IsTrue(target.transform);
        }
        
        
#if UNITY_EDITOR
        public new static string NAME = "Gp/调用Dls-Condition判断";

        public override string GetNodeTitle() {
            return "调用Dls-Condition判断";
        }
#endif
    }
}